package com.guojian.common.http;

import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;
import java.util.Scanner;

public class ClientTest {

	public static void main(String[] args) {

		Socket socket = null;
		OutputStream out = null;

		try {
			socket = new Socket("127.0.0.1", 9001);

			out = socket.getOutputStream();

			out.write("guojian".getBytes());
			out.flush();
			socket.shutdownOutput();

			//socket.getOutputStream().write("ok".getBytes());

		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			try {
				out.close();
			} catch (IOException e1) {
				e1.printStackTrace();
			}

			try {
				socket.close();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}

	}

}
